Carbon


KCNewItem

Header: Keychain.h Carbon status: Under Evaluation

Creates a reference to a keychain item.

OSStatus KCNewItem (
    KCItemClass itemClass, 
    OSType itemCreator, 
    UInt32 length, 
    const void *data, 
    KCItemRef *item
);
itemClass

The type of item (that is, a certificate, AppleShare password, Internet password, or generic password) that you want to create. See “Keychain Item Class Constants” for a description of possible values.

itemCreator

The creator code of the application that owns this item.

length

The length of the data to be stored in this item.

data

A pointer to a buffer containing the data to be stored in this item. Before calling KCNewItem, allocate enough memory for the buffer to hold the data you want to store.

item

On return, a pointer to a reference to the newly-created item.

function result

A result code. The Memory Manager result code memFullErr indicates that you did not allocate enough memory in the current heap to create the item.

DISCUSSION

The KCNewItem function creates a new keychain item from the specified parameters. Note that a copy of the data buffer pointed to by data is stored in the item.

SPECIAL CONSIDERATIONS

If you want to store an item permanently, you must call the function KCAddItem after calling KCNewItem. When the item reference is no longer required, call the function KCReleaseItem to deallocate memory occupied by the item.

VERSION NOTES

Available beginning with Keychain Manager 1.0.

AVAILABILITY

Under evaluation for Carbon. Available in CarbonLib 1.0 and later when KeychainLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by KeychainLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)